﻿using ShaderCompiler.Core;

namespace ShadersCS
{
	public sealed class Present : BaseVS
	{
		public Texture2D NormalTexture, BackgroundTexture;

		[ShaderMethod(ShaderMethodTypes.PS)]
		public void mainPS()
		{
			Vector4 normal = NormalTexture.Sample(Texcoord_VSPS);
			normal = (normal-0.5) * 2.0;

			double r = BackgroundTexture.Sample(Texcoord_VSPS - (normal.xy * .4)).r;
			double g = BackgroundTexture.Sample(Texcoord_VSPS - (normal.xy * .45)).g;
			double b = BackgroundTexture.Sample(Texcoord_VSPS - (normal.xy * .5)).b;
			Color_PS = new Vector4(r, g, b, 1);
		}
	}
}
